import json

import requests

url = 'https://fanyi.baidu.com/sug'

headers = {
    'User-Agent': 'Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Mobile Safari/537.36'
}

# 提交内容
data = {
    'kw': 'hand'
}
# 将请求头和提交内容传入
r = requests.post(url=url, headers=headers, data=data)
# r.text是josn格式  转换为字典
a = json.loads(r.text)
print(a)

k = a.get('data')[0].get('k')
v = a.get('data')[0].get('v')
print(k)
print(v)
